package com.wangyadong.hobby.schedule.jobtask.jvm.OOM;

import java.util.ArrayList;
import java.util.List;

public class RunTimeConstantPoolOOM {

    public static void main1() {
        List<String> list = new ArrayList<>();
        int i = 0;
        while (true) {
            list.add(String.valueOf(i++).intern());
        }

    }

    public static void main(String[] args) {
        String s = new StringBuilder("计算机").append("软件").toString();
        System.out.println(s.intern() == s);

        String s1 = new StringBuilder("ja").append("va").toString();
        System.out.println(s1.intern() == s1);

        main1();

    }
}

